import java.io.*;
import java.util.Random;

/**
 * Created by cxdl on 2016/10/12.
 */
public class exercise_3{
    public static void main(String[] args) throws IOException {
        //Create a file instance
        java.io.File fileR = new java.io.File("report.txt");
        java.io.PrintWriter output = new java.io.PrintWriter(fileR);
        output.println("姓名 "+"学号 "+"语文 "+"数学 "+"英语 "+"物理 "+"化学 "+"总分");

        Random randomno = new Random();

        String lineTxt = null;
        String encoding = "GBK";
        InputStreamReader read = new InputStreamReader(new FileInputStream("name.txt"),encoding);
        BufferedReader bufferedReader = new BufferedReader(read);

        while((lineTxt = bufferedReader.readLine()) != null){
            double scoreC = 75 + randomno.nextGaussian() * 25 * Math.sqrt(0.1);
            double scoreM = 75 + randomno.nextGaussian() * 25 * Math.sqrt(0.1);
            double scoreE = 75 + randomno.nextGaussian() * 25 * Math.sqrt(0.1);
            double scoreP = 75 + randomno.nextGaussian() * 25 * Math.sqrt(0.1);
            double scoreCt = 75 + randomno.nextGaussian() * 25 * Math.sqrt(0.1);//产生成绩
            int scorec = (int) scoreC;
            int scorem = (int) scoreM;
            int scoree = (int) scoreE;
            int scorep = (int) scoreP;
            int scorect = (int) scoreCt;

            output.println(lineTxt+ " " + scorec + " " + scorem + " " + scoree + " " + scorep + " " + scorect + " " + (scorec + scorem + scoree + scorep + scorect));
            }
        read.close();
        output.close();
    }

}
